/* 主容器样式 */
.manual-sql-analysis {
  padding: 24px;
  background: #f0f2f5;
  min-height: 100vh;
}

/* 页面标题样式 */
.analysis-header {
  margin-bottom: 24px;
  padding: 20px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  color: white;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
}

.analysis-header .ant-typography-title {
  color: white !important;
  margin-bottom: 8px;
}

.analysis-header .ant-typography {
  color: rgba(255, 255, 255, 0.85);
}

/* 数据库选择器卡片 */
.database-selector-card {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid #e8e8e8;
}

.database-selector-card .ant-card-body {
  padding: 16px 20px;
}

.database-selector-card .ant-select {
  border-radius: 6px;
}

.database-selector-card .ant-select-selector {
  border: 1px solid #d9d9d9;
  transition: all 0.2s ease;
}

.database-selector-card .ant-select:hover .ant-select-selector {
  border-color: #40a9ff;
}

.database-selector-card .ant-select-focused .ant-select-selector {
  border-color: #1890ff;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

/* 编辑器区域样式 */
.editor-section {
  background: white;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.editor-section .ant-btn {
  border-radius: 6px;
  transition: all 0.2s ease;
}

.editor-section .ant-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* SQL编辑器容器样式 */
.editor-section .sql-editor-container {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e8e8e8;
}

.editor-section .sql-editor-container .ant-card-head {
  background: #fafafa;
  border-bottom: 1px solid #e8e8e8;
  padding: 0 16px;
}

.editor-section .sql-editor-container .ant-card-body {
  padding: 0;
}

/* 工具栏样式 */
.editor-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #fafafa;
  border-bottom: 1px solid #e8e8e8;
  border-radius: 8px 8px 0 0;
}

.editor-toolbar .ant-btn-group .ant-btn {
  border-radius: 0;
}

.editor-toolbar .ant-btn-group .ant-btn:first-child {
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}

.editor-toolbar .ant-btn-group .ant-btn:last-child {
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}

/* 示例SQL下拉菜单样式 */
.example-dropdown-item {
  padding: 8px 12px;
  min-width: 280px;
}

.example-dropdown-item:hover {
  background: #f0f9ff;
}

.example-dropdown-item .example-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.example-dropdown-item .example-name {
  font-weight: 500;
  color: #262626;
}

.example-dropdown-item .example-description {
  font-size: 12px;
  color: #666;
  line-height: 1.4;
}

.example-dropdown-item .example-badge {
  font-size: 10px;
}

/* 光标位置指示器 */
.cursor-position {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 11px;
  color: #666;
  background: rgba(0, 0, 0, 0.04);
  padding: 2px 6px;
  border-radius: 3px;
}

/* 分析面板区域 */
.analysis-panel-section {
  background: white;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  height: fit-content;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .manual-sql-analysis {
    padding: 16px;
  }
  
  .analysis-header {
    margin-bottom: 16px;
    padding: 16px 20px;
  }
  
  .editor-section {
    margin-bottom: 16px;
  }
}

@media (max-width: 768px) {
  .manual-sql-analysis {
    padding: 12px;
  }
  
  .analysis-header {
    padding: 12px 16px;
    margin-bottom: 12px;
  }
  
  .analysis-header .ant-typography-title {
    font-size: 20px;
  }
  
  .database-selector-card .ant-card-body {
    padding: 12px 16px;
  }
  
  .database-selector-card .ant-row {
    flex-direction: column;
    gap: 12px;
  }
  
  .editor-section {
    padding: 12px;
    margin-bottom: 12px;
  }
  
  .editor-toolbar {
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }
}

/* 加载状态 */
.analysis-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* 错误状态 */
.analysis-error {
  background: #fff2f0;
  border: 1px solid #ffccc7;
  border-radius: 8px;
  padding: 16px;
  color: #cf1322;
}

/* 成功状态 */
.analysis-success {
  background: #f6ffed;
  border: 1px solid #b7eb8f;
  border-radius: 8px;
  padding: 16px;
  color: #389e0d;
}

/* 动画效果 */
.manual-sql-analysis .ant-card {
  transition: all 0.3s ease;
}

.manual-sql-analysis .ant-btn {
  transition: all 0.2s ease;
}

.manual-sql-analysis .ant-select {
  transition: all 0.2s ease;
}

/* 主题色彩定制 */
.manual-sql-analysis .ant-btn-primary {
  background: #1890ff;
  border-color: #1890ff;
}

.manual-sql-analysis .ant-btn-primary:hover {
  background: #40a9ff;
  border-color: #40a9ff;
}

.manual-sql-analysis .ant-switch-checked {
  background-color: #1890ff;
}

/* 滚动条样式 */
.manual-sql-analysis ::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.manual-sql-analysis ::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.manual-sql-analysis ::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.manual-sql-analysis ::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}